#ifndef CROWBAR_ICE_H_INCLUDED
#define CROWBAR_ICE_H_INCLUDED

#include <windows.h>
#include "runtime.h"


class Ice_t
{
private:
	static const int StatisticsInterval = 1000;
	DWORD next_tick;
	bool m_active;
	bool m_statistics_enabled;
	
	static BOOL WINAPI EventHandler(DWORD evnt);
	static bool Debugger(Ice_t& self);
	static bool Statistics(Ice_t& self);
	
	struct CommandEntry
	{
		void (*func)(Ice_t& self, int argcount, const char ** args);
		const char * name;
		int minargs;
		int maxargs;
		const char * help;
	};

	static CommandEntry commands[];
	
public:
	Ice_t();
	
	static void command_help(Ice_t& self, int argcount, const char ** args);
	static void command_showcps(Ice_t& self, int argcount, const char ** args);
	static void command_hidecps(Ice_t& self, int argcount, const char ** args);
	static void command_break(Ice_t& self, int argcount, const char ** args);
	static void command_resume(Ice_t& self, int argcount, const char ** args);
	static void command_quit(Ice_t& self, int argcount, const char ** args);
};

extern Ice_t Ice;


#endif // CROWBAR_ICE_H_INCLUDED
